﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Globalization;
using EnvDTE;

namespace SPVisualDev.VSAddin.Dialogs.PropertySheets
{
    internal class CodeClassCollectionTypeConverter : TypeConverter
    {
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            string s = "";
            if (value != null)
            {
                foreach (CodeClass cls in (List<CodeClass>)value)
                {
                    if (s != "")
                        s += "; ";

                    s += cls.FullName;
                }
            }

            if (s == "")
                s = "(none)";

            return s;
        }
    }
}
